b04bfbab976d5f4a4c7e7e599eb3cbd74f35672f
[git-annex.git] /
1 [[!comment format=mdwn
2  username="joey"
3  subject="""comment 2"""
4  date="2025-01-09T17:38:25Z"
5  content="""
6 Seems like a reasonable idea to have a hook that runs before `git-annex
7 init` does any of its probing or configuration.
8
9 As for generalizing to a hook that is run before each git-annex command,
10 putting it in .git/hooks seems like it could cause a fair bit of extra work
11 probing if the hook(s) exist, especially in cases where git-annex runs git
12 which might run git-annex again repeatedly.
13
14 There could be a generalized hook config, eg `git config annex.pre-hook
15 my-hook` could make `git-annex init` run `my-hook git-annex init`
16 and same for other git-annex commands.
17
18 It sounds like you would want a failure of such a hook to prevent the
19 git-annex command from running. Is that right?
20
21 Worth bearing in mind that if such a hook output to stdout, or read from
22 stdin, or for that matter was interactive on /dev/tty, it could badly
23 mess up things that use git-annex as plumbing. Including git, in the case
24 of the smudge filter.
25
26 (Should this todo be tagged repronim btw?)
27 """]]